package com.violet.detective.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.violet.detective.entity.Equipment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.violet.detective.search.EquipmentSearchParameter;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

/**
* @author 21145
* @description 针对表【Equipment】的数据库操作Service
* @createDate 2023-09-04 21:36:49
*/
public interface EquipmentService extends IService<Equipment> {
    boolean addEquipment(Equipment newEquipment, MultipartFile file) throws IOException;
    void showImage(String imageName, HttpServletResponse response) throws IOException;
    boolean editEquipment(Equipment updatedEquipment);
    boolean deleteEquipment(Integer id) throws Exception;
    Equipment getEquipmentById (Integer id);
    Equipment searchEquipments(Integer id);
    List<Equipment> searchEquipments(EquipmentSearchParameter searchParameter);
    Page<Equipment> searchEquipments(EquipmentSearchParameter searchParameter, int pageNum, int pageSize);
    List<Integer> searchEquipmentIdsByName(String name);
    List<Integer> searchEquipmentIdsByMajor(String major);
    List<Equipment> findAllEquipments();
    Page<Equipment> findAllEquipments(int pageNum, int pageSize);
}
